<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="format-detection" content="telephone=no">
    <meta name="viewport" content="initial-scale=1,user-scalable=no,maximum-scale=1,width=device-width">
    <title>我的催收</title>
    <link href="../Content/css/style.css" rel="stylesheet">
    <script src="../Content/js/rem.js"></script>
    <style>
    </style>
</head>
<body>
<div id="loading">
    <img src="../Content/imgs/kbloading.gif">
</div>
    <div class="wrap" >
       <ul id="navbox">
           <li class="active">审核中</li>
           <li>抢单中</li>
           <li>已完成</li>
       </ul>
        <ul class="steps2">
            <li class="steps2__item">
                <p>时间</p></li>
            <li class="steps2__item kd">
                <p>位置</p></li>
            <li class="steps2__item">
                <p>逾期</p></li>
            <li class="steps2__item">
                <p>金额</p></li>
            <li class="steps2__item">
                <p>赏金</p></li>
            <li class="steps2__item">
                <p>状态</p></li>
        </ul>
        <div id="content">
            <div id="shz"></div>
            <div id="qdz" class="dn"></div>
            <div id="ywc" class="dn"></div>
        </div>
    </div>
    <div class="weui-tabbar">
        <a href="javascript:;" class="weui-tabbar__item ">
                    <span style="display: inline-block;position: relative;">
                        <img src="../Content/imgs/ckbar1.png"  class="weui-tabbar__icon ">
                        <img src="../Content/imgs/iconbar1-ac.png"  class="weui-tabbar__icon js-active dn">
                    </span>
            <p class="weui-tabbar__label">大厅</p>
        </a>
        <a href="javascript:;" class="weui-tabbar__item weui-bar__item_on">
            <img src="../Content/imgs/ckbar2.png"  class="weui-tabbar__icon js-active dn">
            <img src="../Content/imgs/iconbar2-ac.png"  class="weui-tabbar__icon ">
            <p class="weui-tabbar__label">我的</p>
        </a>
    </div>
    <script src="../Content/js/jquery-2.2.4.min.js"></script>
<script>
    var str1="";
    var str2="";
    var str3="";
    $.ajax({
        type : "GET",
        url :localStorage.url+"/billList/getMyBillList",
        data :{
            id:localStorage.id,
            page:1,
            pageSize:50
        },
        success : function(ro) {
            var arr=ro.userList;
            $.each(arr,function (i,e) {
                var time=arr[i].apply_time.split("-").join("/");
                if(arr[i].status=="4"){
                    str1+=` <ul class="steps3" data-id=`+arr[i].id+` data-status=`+arr[i].status+` onclick="getInfo(this)">
                                <li class="steps3__item">
                                <p>`+time.substring(5,10)+`</p><p>`+time.substring(0,4)+`</p></li>
                            <li class="steps3__item kd">
                                <p>`+arr[i].lcity+`<span class="small-font">(债权)</span></p> <p>`+arr[i].qcity+`<span class="small-font">(债务)</span></p></li>
                            <li class="steps3__item gd ">
                                <p>`+arr[i].overdue+`个月</p></li>
                            <li class="steps3__item gd zt">
                                <p>`+Number(arr[i].bill_money).toFixed(1)+`K</p></li>
                            <li class="steps3__item gd zt">
                                <p>`+Number(arr[i].reward_money).toFixed(2)+`K</p></li>
                            <li class="steps3__item">
                                <a class="qdzbtn">审核中</a></li>
                            </ul>`
                }else if(arr[i].status=="1"){
                    str2+=` <ul class="steps3" data-id=`+arr[i].id+` data-status=`+arr[i].status+` onclick="getInfo(this)">
                                <li class="steps3__item">
                                <p>`+time.substring(5,10)+`</p><p>`+time.substring(0,4)+`</p></li>
                            <li class="steps3__item kd">
                                <p>`+arr[i].lcity+`<span class="small-font">(债权)</span></p> <p>`+arr[i].qcity+`<span class="small-font">(债务)</span></p></li>
                            <li class="steps3__item gd ">
                                <p>`+arr[i].overdue+`个月</p></li>
                            <li class="steps3__item gd zt">
                                <p>`+Number(arr[i].bill_money).toFixed(1)+`K</p></li>
                            <li class="steps3__item gd zt">
                                <p>`+Number(arr[i].reward_money).toFixed(2)+`K</p></li>
                            <li class="steps3__item">
                                <a class="qdzbtn">抢单中</a></li>
                            </ul>`
                }else if(arr[i].status=="2"){
                    str2+=` <ul class="steps3" data-id=`+arr[i].id+` data-status=`+arr[i].status+` onclick="getInfo(this)">
                                <li class="steps3__item">
                                <p>`+time.substring(5,10)+`</p><p>`+time.substring(0,4)+`</p></li>
                            <li class="steps3__item kd">
                                <p>`+arr[i].lcity+`<span class="small-font">(债权)</span></p> <p>`+arr[i].qcity+`<span class="small-font">(债务)</span></p></li>
                            <li class="steps3__item gd ">
                                <p>`+arr[i].overdue+`个月</p></li>
                            <li class="steps3__item gd zt">
                                <p>`+Number(arr[i].bill_money).toFixed(1)+`K</p></li>
                            <li class="steps3__item gd zt">
                                <p>`+Number(arr[i].reward_money).toFixed(2)+`K</p></li>
                            <li class="steps3__item">
                                <a class="qdzbtn">已抢单</a></li>
                            </ul>`
                }else if(arr[i].status=="3"){
                    str3+=` <ul class="steps3" data-id=`+arr[i].id+` data-status=`+arr[i].status+` onclick="getInfo(this)">
                                <li class="steps3__item">
                                <p>`+time.substring(5,10)+`</p><p>`+time.substring(0,4)+`</p></li>
                            <li class="steps3__item kd">
                                <p>`+arr[i].lcity+`<span class="small-font">(债权)</span></p> <p>`+arr[i].qcity+`<span class="small-font">(债务)</span></p></li>
                            <li class="steps3__item gd ">
                                <p>`+arr[i].overdue+`个月</p></li>
                            <li class="steps3__item gd zt">
                                <p>`+Number(arr[i].bill_money).toFixed(1)+`K</p></li>
                            <li class="steps3__item gd zt">
                                <p>`+Number(arr[i].reward_money).toFixed(2)+`K</p></li>
                            <li class="steps3__item">
                                <a class="qdzbtn">已完成</a></li>
                            </ul>`
                }
            });

            $("#shz").html(str1);
            $("#qdz").html(str2);
            $("#ywc").html(str3);
            $("#loading").hide();
            console.log(ro);
        },
        error : function(err) {
            alert(err);
        }
    });
    function getInfo(obj){
        var $this=$(obj);
        var id=$this.attr("data-id");
        var status=$this.attr("data-status");
        window.location.href="ck-dingdanzt.html?id="+id+"&status="+status;
        console.log(id+status)
    }
//        `;1="
//    var str2=`<ul class="steps3">
//            <li class="steps3__item">
//                <p>07/01</p><p>2017</p></li>
//            <li class="steps3__item kd">
//                <p>朝阳区<span class="small-font">(债权)</span></p> <p>昌平区<span class="small-font">(债务)</span></p></li>
//            <li class="steps3__item gd ">
//                <p>20个月</p></li>
//            <li class="steps3__item gd zt">
//                <p>30K</p></li>
//            <li class="steps3__item gd zt">
//                <p>10K</p></li>
//            <li class="steps3__item">
//                <a class="qdzbtn">已抢单</a></li>
//        </ul>
//        <ul class="steps3">
//            <li class="steps3__item">
//                <p>07/01</p><p>2017</p></li>
//            <li class="steps3__item kd">
//                <p>朝阳区<span class="small-font">(债权)</span></p> <p>昌平区<span class="small-font">(债务)</span></p></li>
//            <li class="steps3__item gd ">
//                <p>20个月</p></li>
//            <li class="steps3__item gd zt">
//                <p>30K</p></li>
//            <li class="steps3__item gd zt">
//                <p>10K</p></li>
//            <li class="steps3__item">
//                <a class="qdzbtn">已抢单</a></li>
//        </ul>
//        `;
//    var str3=`<ul class="steps3">
//            <li class="steps3__item">
//                <p>07/01</p><p>2017</p></li>
//            <li class="steps3__item kd">
//                <p>朝阳区<span class="small-font">(债权)</span></p> <p>昌平区<span class="small-font">(债务)</span></p></li>
//            <li class="steps3__item gd ">
//                <p>20个月</p></li>
//            <li class="steps3__item gd zt">
//                <p>30K</p></li>
//            <li class="steps3__item gd zt">
//                <p>10K</p></li>
//            <li class="steps3__item">
//                <a class="qdzbtn">已完成</a></li>
//        </ul>
//        <ul class="steps3">
//            <li class="steps3__item">
//                <p>07/01</p><p>2017</p></li>
//            <li class="steps3__item kd">
//                <p>朝阳区<span class="small-font">(债权)</span></p> <p>昌平区<span class="small-font">(债务)</span></p></li>
//            <li class="steps3__item gd ">
//                <p>20个月</p></li>
//            <li class="steps3__item gd zt">
//                <p>30K</p></li>
//            <li class="steps3__item gd zt">
//                <p>10K</p></li>
//            <li class="steps3__item">
//                <a class="qdzbtn">已完成</a></li>
//        </ul>
//        `;
    var winH=$(window).height();
    $(".wrap").css("height",winH);
    $(function(){
        $(".weui-tabbar a").on('click',function () {
            var index=$(this).index();
            if(index=="0"){
                window.location.href="ck-index.html"
            }else {
                window.location.href="ck-my.html"
            }
        });
        $("#navbox li").on("click",function () {
            let  index=$(this).index();
            $(this).addClass("active").siblings().removeClass("active");
            //$(this).index()
            $("#content div").eq(index).show().siblings().hide();

        });

    });

</script>
</body>
</html>
